package com.one.consumer.user.ui.binder;

import android.support.annotation.NonNull;
import android.view.View;

import com.one.common.config.RouterPath;
import com.one.common.manager.RouterManager;
import com.one.common.model.extra.DefaultExtra;
import com.one.common.view.multitytype.adapter.BaseItemBinder;
import com.one.common.view.multitytype.adapter.BaseViewHolderMulti;
import com.one.consumer.R;
import com.one.consumer.user.model.item.InvoiceItem;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/11/4 6:58 PM
 * description ：发票记录
 **/
public class InvoiceBinder extends BaseItemBinder<InvoiceItem> {
    public InvoiceBinder() {
        super(R.layout.item_invoice);
    }

    @Override
    protected void bindView(@NonNull BaseViewHolderMulti holder, @NonNull InvoiceItem item) {
        holder.getView(R.id.ll_invoice).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                RouterManager.getInstance().go(RouterPath.INVOICE_DETAIL,new DefaultExtra(item.getOrder_invoice_id()+""));
            }
        });

        holder.setText(R.id.tv_order_no, "订单号："+item.getOrder_no());
        holder.setText(R.id.tv_order_state, item.getInvoice_state());
        holder.setText(R.id.tv_type, "发票类型："+item.getInvoice_class());
        holder.setText(R.id.tv_money, "发开票金额："+item.getOrder_price()+"元");
    }
}
